package com.ls.controller.rule.model;

import com.alibaba.fastjson.annotation.JSONField;
import com.baomidou.mybatisplus.annotation.TableField;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.ls.entity.Linkman;
import com.ls.entity.SmsTemplate;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.time.LocalDate;
import java.time.LocalDateTime;
import java.time.LocalTime;
import java.util.List;

/**
 * @ClassName CareRuleModel
 * @Description APP用户 关怀短信model
 * @Author pengyu
 * @Date 2024/6/27 17:14
 * @Version 1.0
 **/
@Data
@NoArgsConstructor
@AllArgsConstructor
@Builder
public class CareRuleModel {
    private Long ruleId;
    /**模板类别 0为挂机短信，1为关怀短信；为0时call_type生效，1时holiday_id生效*/
    private Integer templateCategory;
    /**节假日id template_category1时生效*/
    private Long holidayId;
    /**提前发送n天，template_category为1时生效*/
    private Integer advance;

    /**
     * 规则名称
     */
    private String ruleName;

    /**
     * 规则是否启用
     */
    private Integer validFlag;
    /**任务执行总次数*/
    private Integer taskCount;

    /**
     * APP用户主键
     */
    private Long customerId;

    /**
     * C端用户手机号码
     */
    private String phone;
    /**规则生效时间*/
    @JsonFormat(pattern = "HH:mm:ss", timezone = "GMT+8")
    @JSONField(format = "HH:mm:ss")
    private LocalTime startTime;

    /**
     * 创建时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @JSONField(format = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime createTime;

    /**
     * 更新时间，自动
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @JSONField(format = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime updateTime;

    @TableField(exist = false)
    private Integer linkmanNum;
    @TableField(exist = false)
    private String holidayName;
    /**规则生效日期*/
    @TableField(exist = false)
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    @JSONField(format = "yyyy-MM-dd")
    private LocalDate nextDay;

    /**是否下次执行 1是，0否*/
    @TableField(exist = false)
    private Integer isNext;
}
